<%= form_for @category, :html => { :class => "form-horizontal"} do |f| %>
  <% if @category.errors.any? %>
    <div id="error_explanation">
      <h2><%= pluralize(@account.errors.count, "error") %> evito que se pueda grabar el usuario:</h2>

      <ul>
      <% @category.errors.full_messages.each do |msg| %>
        <li><%= msg %></li>
      <% end %>
      </ul>
    </div>
  <% end %>
  <h3>Datos generales</h3>  
  <div class="control-group">
    <%= f.label :name,"Nombre", :class => "control-label" %>
    <div class="controls">
      <%= f.text_field :name, :class => "span6" %>
    </div>    
  </div>
  <div class="control-group">
    <%= f.label :category_type,"Tipo", :class => "control-label" %>
    <div class="controls">
      <%= f.select :category_type, options_for_select([["Standard", "standard"], ["Title", "title"],["Standard-Title","standard-title"],["Subheader","subheader"],["Subcategory","subcategory"]],@category.category_type) %>
    </div>    
  </div>
  <div class="control-group">
    <%= f.label :section_id,"Sección", :class => "control-label" %>
    <div class="controls">
      <%= collection_select(:category, :section_id, @all_sections, :id, :name, {:prompt => true}) %>
    </div>    
  </div>
  <div class="control-group">
    <%= f.label :parent_category_id,"Categoria Padre", :class => "control-label" %>
    <div class="controls">
      <%= collection_select(:category, :parent_category_id, @parent_categories, :id, :name, {:prompt => true}) %>
    </div>    
  </div>  
  <div class="control-group">
    <%= f.label :category_order,"Orden", :class => "control-label" %>
    <div class="controls">
      <%= f.text_field :category_order, :class => "span1" %>
    </div>    
  </div>

  <div class="form-actions" style="padding-left: 20px;">
    <button type="submit" class="btn btn-primary">Grabar</button>
    <%= link_to "Cancelar",categories_path, :class => "btn btn-warning" %>
  </div>
<% end %>
